# Create your views here.
from django.http import HttpResponse,HttpResponseRedirect
from django.shortcuts import render

# create your views here
def index(request):
    # return HttpResponse("Hello Django!")
    return render(request, 'index.html')


def login_action(request):
    if request.method == 'POST':
        username = request.POST.get('username', '')
        password = request.POST.get('password', '')
        if username == 'admin' and password == 'admin123':
            return HttpResponseRedirect('/event_manage/')
        else:
            return render(request, 'index.html', {'error':'username or password error!'})

def enent_manage(request):
    return render(request, 'event_manage.html')